//
// Created by mio on 25-4-17.
//

#include <iostream>
#include "../Net/EventLoop.h"
#include "RtmpServer.h"

int main()
{
    EventLoop loop(4);
    auto rtmp_server = RtmpServer::Create(&loop);
    rtmp_server->SetChunkSize(60000);
    rtmp_server->SetEventCallback([](std::string type, std::string path)
    {
       printf("[Event]%s, stream path:%s\n",type.c_str(), path.c_str());
    });
    if (!rtmp_server->Start("127.0.0.1", 1935))
    {
        std::cout << "Server start failed\n";
    }
    std::cout << "Server start success\n";
    while (1)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
    }
    return 0;
}